@echo off
chcp 65001 >nul
echo ====================================
echo 初始化本地成就系统数据库
echo ====================================
echo.
echo 请输入MySQL的root密码（如果没有密码直接回车）：
echo.

cd /d "%~dp0math-academy\database"

mysql -u root -p math_academy < achievements-system-mysql57.sql

echo.
echo ====================================
echo 执行完成！
echo ====================================
echo.
echo 验证成就数量：
mysql -u root -p -e "USE math_academy; SELECT COUNT(*) as achievement_count FROM achievements;"

echo.
pause

